<template>
  <div>
    <h1>{{ msg }}  当前路径:{{this.$router.currentRoute.fullPath}}</h1>
    <input v-model="timestamp" placeholder="时间戳_秒"/>
    <input v-model="timestampMills" placeholder="时间戳_豪秒"/>

  </div>
</template>

<script>
import md5 from 'js-md5'
export default {
  name: 'tool',
  data () {
    return {
      msg: '欢迎来到菜鸟教程zhangyi',
      site: '菜鸟是你爸爸zhangyi',
      timestamp: '',
      timestampMills: ''
    }
  },
  created () {
    this.users()
  },
  methods: {
    users: function () {
      var req = {
        method: 'post',
        url: 'http://127.0.0.1:9400/tool/v1/timestamp',
        withCredentials: true,
        route: this.$router,
        $proxy: this
      }

      this.$axios.get(req.url, {headers: {'authorization': this.$global.token}}).then(function (value) {
        console.log(value)
        req.$proxy.timestamp = value.data.timestamp
        req.$proxy.timestampMills = value.data.timestampMills
      })
    },
    hello: function (data) {
      console.log(md5(this.msg + '学习' + data))
    }
  }
}
</script>

<!-- Add 'scoped' attribute to limit CSS to this component only -->
<style scoped>

</style>
